from socket import socket

server = socket()
server.bind(('10.7.156.1', 8082))
server.listen(512)
while True:
    connection, address = server.accept()
    # 发送图片
    with open('海贼王/shanji.jpeg', 'rb') as f:
        data = f.read()
    # 图片长度
    connection.send(str(len(data)).encode())
    # 图片数据
    connection.send(data)

